﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Comment>" %>
<%@ Import Namespace="FeaturesBlog.Models" %>
<%@ Import Namespace="FeaturesBlog.Helpers" %>
<div class="comment">
    <div class="commentHeader">
        Create <%= (Model.CommentDate.ToString()) %> by <b><%= Model.User != null ? 
                                                                string.Format(@"<a href='/Home/Journal/' style='color:#bfbfff'>{0}</a>", Html.Encode(Model.User.UserName.ToString()))
                                                                 : (Model.UserDisplayName != string.Empty && Model.UserDisplayName != null ? Model.UserDisplayName : "Anonymous")%></b> <%= HttpContext.Current.User.Identity.IsAuthenticated ? string.Format("({0})", Model.IP) : string.Empty %>
        <%if (HttpContext.Current.User.Identity.IsAuthenticated)
          { %>
        <div class="commentAction">
            <%= Html.ActionLink("[x]", "Delete", "Post", new { id = Model.CommentId }, new { onclick = "return confirm('Are you sure?')" })%>
        </div>
        <%} %>
    </div>
    <%= new HtmlHelpers().EncodeHtmlForComment(Model).CommentBody.ToString()%>
</div>